﻿using System;
using System.Collections.ObjectModel;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using PublicDomain.Data.Csv;
using PublicDomain.Data.Csv.Metadata;
using PublicDomain.Framework.UnitTesting;

namespace PublicDomain.UnitTest.Data.Csv.Metadata
{
    [TestClass]
    public class CsvDataFormatTest
    {
        public TestContext TestContext { get; set; }

        public void TestInitialize()
        {
        }

        [TestMethod]
        [Description("Tests method CsvDataFormat.GetCsvColumnSchema for the case when parameter 'columnName' is null.")]
        public void GetCsvColumnSchemaColumnNameIsNullTest()
        {
            var target = new CsvDataFormat();

            AssertExtensions.ThrowsArgumentNullException(() => target.GetCsvColumnSchema(null), "columnName");
        }

        [TestMethod]
        [Description("Tests method CsvDataFormat.GetCsvColumnSchema for the case when parameter 'columnName' is empty.")]
        public void GetCsvColumnSchemaColumnNameIsEmptyTest()
        {
            var target = new CsvDataFormat();

            ArgumentException argumentException;
            AssertExtensions.ThrowsArgumentException(
                () => target.GetCsvColumnSchema(String.Empty),  
                "The parameter 'columnName' cannot be empty.\r\nParameter name: columnName",
                "columnName",
                out argumentException);
        }
    }
}
